'''
Author: LHY 2601958675@qq.com
Date: 2023-05-16 11:44:58
LastEditors: LHY
LastEditTime: 2023-05-17 18:26:02
Description: 
'''
import pymysql


class Mysql(object):
    def __init__(self):
        # 创建连接
        self.coon = pymysql.Connect(
            host="127.0.0.1",  # 本机地址
            port=5555,  # MySQL端口，默认3306
            user='root',  # 超级管理员用户
            password='123456',  # 数据库的密码
            db='My_data'  # 指定数据库
        )
        # 创建游标 -- 执行sql语句
        self.cursor = self.coon.cursor()


if __name__ == '__main__':
    My = Mysql()
